home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98b.txt / 000146_icon-group-sender _Tue Jul 28 16:33:27 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.8/8.8.7) with SMTP id QAA08147
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Tue, 28 Jul 1998 16:33:26 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA28615; Tue, 28 Jul 1998 16:33:09 -0700
  7. From: dae_alt@juno.com
  8. To: icon-group@optima.CS.Arizona.EDU
  9. Date: Tue, 28 Jul 1998 14:32:18 PDT
  10. Subject: Xcode puzzlement
  11. Message-Id: <19980728.143221.2807.0.dae_alt@juno.com>
  12. X-Mailer: Juno 1.49
  13. X-Juno-Line-Breaks: 0-2,4-65
  14. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  15. Status: RO
  16. Content-Length: 1483
  17.  
  18. To Icon user group:
  19.  
  20. I cannot figure this out.
  21. Program 1 writes to disk and reads from disk the file 'xstore', which it
  22. uses in xdecode().
  23. Program 2 reads the same file as Program 1, but xdecode() fails.
  24. (Run Program1 first, to create the disk file 'xstore')
  25. Help!
  26.  
  27. #---------------------------------------------
  28. #program1.icn
  29. link xcode
  30. record testit( a,b,c)
  31. procedure main()
  32. #write it
  33.   f := open("xstore","w")
  34.   x := testit()
  35.   x.a := "doug"
  36.   x.b := 34
  37.   x.c := "mardi gras"
  38.   xencode(x,f)
  39.   close(f)
  40. #read it
  41.   g := open("xstore")
  42.   y := xdecode(g)
  43.   \y | stop("y is null")
  44.   close(g)
  45.   write(y.a) 
  46.   write(y.b)
  47.   write(y.c)
  48. end
  49. #---------------------------------------------
  50.  
  51. #program2.icn
  52. link xcode
  53. record testit( a,b,c)
  54. procedure main()
  55. #write it
  56. #  f := open("xstore","w")
  57. # x := testit()
  58. #  x.a := "doug"
  59. #  x.b := 34
  60. #  x.c := "mardi gras"
  61. #  xencode(x,f)
  62. #  close(f)
  63. #read it
  64.   g := open("xstore")
  65.   y := xdecode(g)
  66.   \y | stop("y is null")
  67.   close(g)
  68.   write(y.a)
  69.   write(y.b)
  70.   write(y.c)
  71. end
  72. #-----------------------------------
  73.  
  74. I have no idea why xdecode() fails in program2.
  75. The code is identical to that in program1
  76.  
  77.  
  78.  
  79.  
  80.  - Doug Edmunds - 
  81. edmunds@ethergate.com
  82. --- END OF REAL MESSAGE ---
  83. (Don't bother to read past here)
  84.  
  85. _____________________________________________________________________
  86. You don't need to buy Internet access to use free Internet e-mail.
  87. Get completely free e-mail from Juno at http://www.juno.com
  88. Or call Juno at (800) 654-JUNO [654-5866]
  89.